<extend name="Layout:layout" />
<block name="body_main">
    <div class="block box">
        <div class="blank"></div>
        <div id="ur_here">
            当前位置: <a href="{:U('EShop/Index/index')}">首页</a>
            <foreach name="abreadcrumb" item="vo">
                &nbsp;&gt;&nbsp;<a href="{:U('products','cid='.$vo['id'])}">{$vo.title}</a>
            </foreach>
        </div>
    </div>
    <div class="blank"></div>
    <div class="block clearfix">
        <div class="AreaL">
            <div id="category_tree">
                <div class="tit">所有商品分类</div>
                <dl class="clearfix" >
                    <div class="box1 cate" id="cate" data-value="{$cid}">
                        <product_category:get_tree remark="页面顶部商品二级分类">
                            <h1 onclick="tab({$key})">
                                <span class="f_l"><img src="__THEME__images/btn_fold.gif" style="padding-top:10px;padding-right:6px;cursor:pointer;"></span>
                                <a href="{:U('products','cid='.$vo['id'])}" class="f_l">{$vo.title}</a>
                            </h1>
                            <if condition="$vo['children']">
                                <ul style="display:none" >
                                    <foreach name="vo['children']" item="vo2">
                                        <a class="over_2" href="{:U('products','cid='.$vo2['id'])}">{$vo2.title}</a>
                                        <div class="clearfix"></div>
                                    </foreach>
                                </ul>
                            </if>
                            <div style="clear:both"></div>
                        </product_category:get_tree>
                    </div>
                    <div style="clear:both"></div> 
                </dl>
            </div>
            <div class="blank"></div>
            <script type="text/javascript">
                obj_h4 = document.getElementById("cate").getElementsByTagName("h4")
                obj_ul = document.getElementById("cate").getElementsByTagName("ul")
                obj_img = document.getElementById("cate").getElementsByTagName("img")
                function tab(id)
                {
                    if (obj_ul.item(id).style.display == "block")
                    {
                        obj_ul.item(id).style.display = "none"
                        obj_img.item(id).src = "__THEME__images/btn_fold.gif"
                        return false;
                    } else
                        (obj_ul.item(id).style.display == "none")
                    {
                        obj_ul.item(id).style.display = "block"
                        obj_img.item(id).src = "__THEME__images/btn_unfold.gif"
                    }
                }
            </script>
            <div class="box" id='history_div'> 
                <div class="box_1">
                    <h3><span>浏览历史</span></h3>

                    <div class="boxCenterList clearfix" id='history_list'>
                        <ul class="clearfix"><li class="goodsimg"><a href="{:U('products')}" target="_blank"><img src="__THEME__images/95_thumb_G_1460424620987.jpg" alt="孚日家纺提花染色四件套炫蓝意韵" class="B_blue" /></a></li><li><a href="goods.php?id=95" target="_blank" title="提花染色四件套炫蓝意韵">提花染色四件套炫蓝意韵</a><br />本店售价：<font class="f1">￥1380元</font><br /></li></ul><ul id="clear_history"><a onclick="clear_history()">[清空]</a></ul>  </div>
                </div>
            </div>
            <div class="blank5"></div>
            <script type="text/javascript">
                if (document.getElementById('history_list').innerHTML.replace(/\s/g, '').length < 1)
                {
                    document.getElementById('history_div').style.display = 'none';
                } else
                {
                    document.getElementById('history_div').style.display = 'block';
                }
                function clear_history()
                {
                    Ajax.call('user.php', 'act=clear_history', clear_history_Response, 'GET', 'TEXT', 1, 1);
                }
                function clear_history_Response(res)
                {
                    document.getElementById('history_list').innerHTML = '您已清空最近浏览过的商品';
                }
            </script>

        </div>


        <div class="AreaR">
            <div class="box">
                <div class="box_1">
                    <h3>
                        <span>商品列表</span>
                    </h3>
                    <form name="compareForm" action="compare.php" method="post" onSubmit="return compareGoods(this);">
                        <div class="clearfix goodsBox" style="border:none; padding:11px 0 10px 0px;">
                            <foreach name="list" item="vo">
                                <div class="goodsItem" >
                                    <a href="{:U('product','id='.$vo['id'])}"><img src="{$vo.picture_url}" alt="{$vo.title}" class="goodsimg" /></a><br />
                                    <p><a href="{:U('product','id='.$vo['id'])}" title="{$vo.title}">{$vo.title}</a></p>
                                    市场价：<font class="market_s">￥{$vo.market_price}元</font><br />
                                    本店价：<font class="shop_s">￥{$vo.price}元</font><br />
                                </div>
                            </foreach>
                        </div>
                    </form>
                </div>
            </div>
            <div class="blank5"></div>
            <div id="pager" class="pagebar">
                {$page}
            </div>            
        </div>  

    </div>
</block>